package Client;

import module.ExamManage;
import module.StudentManage;

import java.io.IOException;

public class ManageMainPage {

    private static ClientInitClose client;

    public void manageMainPage(ClientInitClose client) throws IOException {
        ManageMainPage.client = client;

        while (true) {
            System.out.println("-----管理员系统-----");
            System.out.println("  1、学员管理");
            System.out.println("  2、考题管理");
            System.out.println("  0、退出系统");
            int choose = ClientScanner.getScanner().nextInt();
            switch (choose) {
                case 1:
                    client.getOut().writeObject("studentmanage");
                    StudentManage sm = new StudentManage();
                    sm.studentManage(client);
                    break;
                case 2:
                    client.getOut().writeObject("questionmanage");
                    ExamManage examManage = new ExamManage();
                    examManage.examManage(client);
                    break;
                case 0:
                    client.getOut().writeObject("1");
                    return;
                default:
                    break;
            }
        }
    }
}
